package com.ruoyi.controller;

import com.ruoyi.vo.User;
import com.ruoyi.service.LoginService;
import com.ruoyi.utils.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Resource
    private LoginService loginService;


    @RequestMapping("/loginUsername")
    public Result loginUsername(@RequestBody User user){
        System.out.println(11191119);

        return loginService.login(user);
    }

    @RequestMapping("/sendCode")
    public Result sendCode(@RequestParam("mobile") String mobile){

        return loginService.sendCode(mobile);
    }

    @RequestMapping("/loginMobile")
    public Result loginMobile(@RequestBody User user){

        return loginService.loginMobile(user);
    }
}
